;$(function() {
	getInfo();
})


function getInfo(){
	   $.ajax({
           url: ctxPath+"/agency/org/getInfo",
           type: 'GET',
           success: function(d){
           	var success = d.success;
           	 if(success==true){
           	 var data=  d.data;
           	    if(data==null){
           	    	return;
           	    }
           		 $("#name").html(data.name);
           		 $("#cityName").html(data.cityName);
           		 $("#countyName").html(data.countyName);
           		 $("#streetName").html(data.streetName);
           		 $("#detailAddress").html(data.detailAddress);
           		 $("#my-editormd").html(data.content);
           		 if(data.files!=null){
           			 var img = "";
           			 var url=ctxPath+"/file/showImage/";
           			 for(var i=0;i<data.files.length;i++){
           				 var temp = url+data.files[i];
           				 img+='<div class="imgbox"><img class="smallimg" alt="" src="'+temp+'" style="width:200px;"></div><br>';
           			 }
           			 $("#files").html(img);
           			var map = new BMap.Map("allmap", {enableMapClick: false});
           			setTimeout(function() {		//添加延时加载。解决问题
           				console.log(data.lat,data.lon);
           			var point = new BMap.Point(data.lat,data.lon);
           			map.centerAndZoom(point,15);
           			map.addControl(new BMap.MapTypeControl({
           				mapTypes:[
           		            BMAP_NORMAL_MAP,
           		            BMAP_HYBRID_MAP
           		        ]}));
           			var marker2 = new BMap.Marker(point);  // 创建标注
           			map.addOverlay(marker2);
           			},300);
           		 }
           	 }
           }
       });
}

